#ifndef LECOMPTEESTBON_H
#define LECOMPTEESTBON_H

#include <QMainWindow>
#include <QtGui>
#include <qtimer.h>

#include "GameCore/TheGame.h"

struct T_QtOperation : T_Operation
{
        QPushButton* ptButtonA;
        QPushButton* ptButtonB;
};

struct T_QtResult
{
        QPushButton* ptButtonA;
        QPushButton* ptButtonB;
        QPushButton* ptDelButton;
        QLabel* ptResultLabel;
        QPushButton* ptResultButton;
        char cOperation;
};

class LeCompteEstBon : public QMainWindow
{
    Q_OBJECT

    public:
        LeCompteEstBon(QWidget *parent = 0);
        ~LeCompteEstBon();

    private slots:
        void checkGameData();
        void deleteResult();
        void selectInteger();
        void selectOperation();
        void newGame();
        void findSolution();
        void generateAndFindSolution();
        void exit();
        void about();
        void aboutQt();

    private:
        void setTime(int _iSeconds);
        void addResult(const T_QtOperation& _operation);
        void stopTheGame();

    private:
        QPushButton* m_ptIntButton[6];
        T_QtResult m_aResult[5];

        QLabel* m_ptResultToFindLabel;
        QProgressBar* m_ptTimerBar;
        QLabel* m_ptTimerLabel;

        TheGame m_game;

        T_QtOperation m_currentOperation;

        bool m_bIsGameStarted;
        bool m_bIsGameDataAvailable;
        QTimer* m_ptIdleTimer;
};

#endif // LECOMPTEESTBON_H
